import request from '@/utils/request'

// 查询列表
export function list(url, params, method, ContentType) {
  if (method == 'GET'|| method == 'get') {
    return request({
      url,
      params,
      method,
    })
  } else {
    let Content = 'application/json'
    if (ContentType == 'json') {
      Content = 'application/json'
    } else {
      Content = 'application/x-www-form-urlencoded'
    }
    return request({
      url: url,
      method,
      data: params,
      headers: {
        'Content-Type': Content //含有附件的表单提交的Content-Type
        //'Content-Type': 'application/x-www-form-urlencoded'//普通表单提交的Content-Type
      },
    })
  }
}

// 查询列表
export function listPost(url, query) {
  return request({
    url: url,
    method: 'post',
    data: query
  })
}
